<?php
@session_start();
require_once '../../config/config.inc';
$conn = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$conn){
	echo mysql_error();
}
$db=mysql_select_db(DB_DATABASE);
if(!$db){
	mysql_error();
}

$id=$_GET['id'];
$qry=mysql_query("SELECT * from `event` where id='$id'");
if (!$qry){
	echo mysql_error();
}
$row=mysql_fetch_array($qry);


$we=mysql_query("delete  from `event` where id='$id'");
if ($we) {
$path1="../assets/uploadfile/".$row['agenda'];
$path = "../assets/img/eventphoto/".$row['photo'];
$we=unlink($path);
$qry=unlink($path1);
header("location:../myevent.php?status=success");
}else{
	
	echo mysql_error();
}
?>